/*
 * @Author: mikey.zhaopeng 
 * @Date: 2019-01-07 20:54:47 
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2019-01-11 15:43:33
 * @用户详细资料页面
 */
 <template>
  <div class="information">
    <Header
      :is-left="true"
      title="详细资料"
      btn_icon="ellipsis-h"
    />
    <!--  -->
    <div class="container">
      <InfoCell :userInfo="targetUser"></InfoCell>
      <div class="btn_wrap">
        <!-- <YButton @click="$router.push({name:'chat',params:{user:JSON.stringify(targetUser)}})">发消息</YButton> -->
        <YButton @click="goInfo(targetUser)">发消息</YButton>
      </div>
    </div>
  </div>
</template>
 <script>
import Header from "./../components/Header";
import InfoCell from "./../components/InfoCell";
import YButton from "./../components/YButton";
export default {
  components: { Header, InfoCell, YButton },
  data() {
    return {};
  },
  computed: {
    //  提取vuex中存入的用户详细资料
    targetUser() {
      return this.$store.getters.targetUser;
    }
  },
  methods: {
      goInfo(targetUser){
         this.$router.push({
             path:'/chat',
             query:{
              //  转码
                //  user:encodeURI(JSON.stringify(targetUser))
                 user:JSON.stringify(targetUser)
                 }
                })
      }
  },
  updated() {},
  beforeDestroy() {
    //  localStorage.setItem('user', JSON.stringify(this.$store.getters.targetUser))
    //  sessionStorage.setItem('users', JSON.stringify(this.$store.getters.targetUser))
      
  }
};
</script>
 <style scoped>
.information {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.container {
  width: 100%;
  height: calc(100% - 50px);
  margin-top: 50px;
  box-sizing: border-box;
  padding: 16px 0;
  background-color: #f1f1f1;
}
</style>
 
 
 
